﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Cwjk_PzRuleSet_EntryEdit.aspx.vb" Inherits="PubProject.Cwjk_PzRuleSet_EntryEdit" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head runat="server">
    <title>凭证规则设置</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
	<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
	<meta content="JavaScript" name="vs_defaultClientScript">
	<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
	<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
	<script language="javascript" src="/_common/scripts/global.js"></script>
	<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
	<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
	<script language="javascript" src="/_controls/settings.aspx"></script>
	<script language="javascript" src="/_controls/util/util.js"></script>
	<style type="text/css">
	   .tdClass{ BORDER-left:#7B9EBD 1px solid;BORDER-top:#7B9EBD 1px solid;}
	</style>	
	<script language="javascript" src="/PubProject/Cwjk/Cwjk_Public.js"></script>
	<script language="javascript" src="/PubProject/Cwjk/Cwjk_PzRuleSet_EntryEdit.js"></script>
	<script language="javascript">
	    var _MyHelpfile = "/Cbgl/Help/topics/财务人员/设置财务接口/设置凭证规则.html";
	    function document.onkeydown()
        {
            try
            {
                if (event.keyCode == 8)
                {
                    var s = event.srcElement.tagName;
                    if (s && s != "INPUT" && s != "TEXTAREA") 
                    {
                        event.returnValue = false;
                    }
                    else if (event.srcElement.type != "text")
                    {
                        event.returnValue = false;
                    }
                    else if (event.srcElement.readOnly)
                    {
                        event.returnValue = false;
                    }
                }
            }
            catch(e){}
        }
	    function window.onload()
	    {
	        if (!document.all["__OperTypeGUID"] || document.all["__OperTypeGUID"].value == "")
	        {
	            document.all["txtOperType"].readOnly = true;
				document.all["txtOperType"].style.backgroundColor = "transparent";
				document.all["txtOperType"].style.borderColor = "#cccccc";
				document.all["img_UsedScope"].disabled = true;
				document.all["img_UsedScope"].style.filter = "gray";				
	            document.all["btnSave"].disabled = true;
	            
	        }
	        else
	        {
	            if(document.all["txtIsDisable"].value == "True")
	            {
	                document.all["txtOperType"].readOnly = true;
				    document.all["txtOperType"].style.backgroundColor = "transparent";
				    document.all["txtOperType"].style.borderColor = "#cccccc";
				    document.all["img_UsedScope"].disabled = true;
				    document.all["img_UsedScope"].style.filter = "gray";				
	                document.all["btnSave"].disabled = true;
	                document.all["rad_IsDisable1"].checked = true;
	            }
	            else
	            {
	                document.all["rad_IsDisable0"].checked = true;
	            }
	            if(document.all["txtIsShowUsedScope"].value == "True")
	            {
	                document.all["tr_UsedScope"].style["display"] = "";
	            }
	        }
	        if (document.all["__Application"] && document.all["__Application"].value == "0101")
	        {
	            _MyHelpfile = "/Slxt/Help/topics/财务管理/财务接口设置/设置凭证规则.html";
	        }
	    }
	    //如果已修改数据，关闭窗体时提示是否保存
        function window.onbeforeunload() 
        {
            //保存后刷新页面时不需要提示
            if (document.all["txtIsPrompt"].value == "0") return;
            var sIsChange = document.all["txtIsChange"].value;
            if (sIsChange == "1") 
            {
                window.event.returnValue = "------------------------------------------------------\n确定后，将不保存当前记录，直接关闭当前页面。\n------------------------------------------------------";
            }
            else
            {
                //修改业务场景或凭证字后，焦点不离开修改的文本框，直接点IE的关闭，此时不会触发onchange事件
                //为了处理这种情况添加了如下代码
                if (document.all["txtOperType"].value != document.all["txtOldOperType"].value)
                {
                    window.event.returnValue = "------------------------------------------------------\n确定后，将不保存当前记录，直接关闭当前页面。\n------------------------------------------------------";
                }
                else
                {
                    //校验凭证字
                    var arrPzz = document.getElementsByName("txtPzz");
                    for (var i =0 ; i <= arrPzz.length -1 ; i++)
                    {
                        if(arrPzz[i].value != arrPzz[i].oldValue)
                        {
                            window.event.returnValue = "------------------------------------------------------\n确定后，将不保存当前记录，直接关闭当前页面。\n------------------------------------------------------";
                            break;
                        }
                    }
                }
            }
        }
	</script>
</head>
<body MS_POSITIONING="GridLayout" style="BORDER:#889DC2 1px solid;MARGIN: 10px;background-color:#FFFBFF" >
    <form id="form1" runat="server">
    <asp:textbox id="txtCwztGUID" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtApplication" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtHierarchyCode" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtParentCode" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtIsUsedScopeRepeat" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtIsShowUsedScope" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtParentDataFilter" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtDataFilter" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtIsDisable" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtAmountFiled" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtIsChange" runat="server" style="display:none">0</asp:textbox>
    <asp:textbox id="txtIsPrompt" runat="server" style="display:none">1</asp:textbox>
    <asp:textbox id="txtOldOperType" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtDeletePzEntryGUIDList" runat="server" style="display:none"></asp:textbox>
        <table style="TABLE-LAYOUT: fixed;FONT-SIZE:9pt; WIDTH: 100%; HEIGHT: 100%" cellSpacing="0" cellPadding="0">
            <colgroup>
			    <col width="60">
			    <col width="5">
			    <col width="100">
			    <col width="15">
			    <col width="60">
			    <col width="5">
			    <col >
			    <col width="15">
			    <col width="50">
			    <col width="5">
			    <col width="120">
		    </colgroup>
            <tr height="25"  valign="center">
                <td class="req">业务类型</td>
                <td ></td>
                <td><input type="text" id="txtParentOperType" runat="server"  readOnly style="background-color:transparent;border-color:#cccccc"></input></td>
                <td ></td>
                <td class="req">业务场景</td>
                <td ></td>
                <td><input type="text" class="txt" id="txtOperType" runat="server" maxlength="50" forbiddenchars="@%#?|,-;'&quot;&amp;&lt;&gt;" oldValue="" onchange="chgOperType()"></input></td>
                <td ></td>
                <td >当前状态</td>
                <td ></td>
                <td  align="right">
                    <table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT:fixed">
                        <col width="20">
                        <col width="40">
                        <col width="20">
                        <col width="40">                        
                        <tr>
                            <td><input type="radio" id="rad_IsDisable0" name="rad_IsDisable" value="0" disabled>
                            </td>
                            <td class="radioLabel" align="right"><label for="rad_IsDisable0">启用</label>
                            </td><td>
                            <input type="radio" id="rad_IsDisable1" name="rad_IsDisable" value="1" disabled>
                            </td>
                            <td class="radioLabel" align="right"><label for="rad_IsDisable1">禁用</label>
                            </td>
                            
                        </tr>
                     </table>
                </td>
            </tr>
            <TR height="5"><TD colSpan="11"></td>
            <tr height="25" id="tr_UsedScope" style="display:none">
                <td class="req">适用范围</td>
                <td ></td>
                <td height="22" colspan="9">
                    <table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT:fixed">
                        <col>
                        <col width="25" align="right">
                        <tr valign="top">
                            <td>
                                <input type="text" id="txtUsedScope" runat="server" readOnly style="background-color:transparent;border-color:#cccccc">
                                </input>
                            </td>
                            <td align="right">
                                <img style="cursor:hand" src="/_imgs/btn_off_lookup.gif" onclick="SelectUsedScope()" id="img_UsedScope"></img>
                            </td>
                        </tr>
                     </table>
                </td>
            </tr>
            <tr height="1">
            <tr>
                <td colspan="11">
                <mnu:AppGridMenu id="appGridMenu" runat="server" />
                </td>
            </tr>
            
		    <tr>
			    <td colspan="11" valign="top">
				    <div id="div_PzEntryRule" style="height:expression((document.body.clientHeight-140)+'px');width:100%;overflow:auto;BORDER:#7B9EBD 1px solid;" runat="server" enableviewstate="False">
				    </div>
			    </td>
		    </tr>
            <TR height="40">
			    <TD class="buttons" colSpan="11">
				    <TABLE style="WIDTH: 100%; HEIGHT: 100% " cellSpacing="0" cellPadding="0">
					    <TR>
						    <TD align="right">
							    <BUTTON style="WIDTH: 70px" onclick="SavePzEntryRule()" id="btnSave" type="button">保 存</BUTTON>&nbsp;&nbsp;
							    <BUTTON style="WIDTH: 70px" onclick="parent.window.close();" id="btnClose" type="button">关 闭</BUTTON>
						    </TD>
					    </TR>
				    </TABLE>
			    </TD>
		    </TR>
        </table>
    </form>
</body>
</html>
